const getNowFormatDate = () => {
  var date = new Date();
  var seperator1 = "";
  var year = date.getFullYear();
  var month = date.getMonth() + 1;
  //   console.log("getNowFormatDate", month);
  var strDate = date.getDate();
  if (month >= 1 && month <= 9) {
    month = "0" + month;
  }
  if (strDate >= 0 && strDate <= 9) {
    strDate = "0" + strDate;
  }
  var currentdate = year + seperator1 + month + seperator1 + strDate;
  return currentdate;
};

const getNowInUserDateAdd30 = () => {
  var date = new Date();
  var seperator1 = "";
  var year = date.getFullYear();
  var month = date.getMonth();
  month = month + 1; //记住条件下保持6个月免登陆
  //   console.log("getNowInUserDateAdd30月份", month);
  var strDate = date.getDate();
  if (month >= 1 && month <= 9) {
    month = "0" + month;
  }
  if (strDate >= 0 && strDate <= 9) {
    strDate = "0" + strDate;
  }
  var currentdate = year + seperator1 + month + seperator1 + strDate;
  return currentdate;
};

const getNowDateAddYaer = () => {
  var date = new Date();
  var seperator1 = "";
  var year = date.getFullYear() + 1;
  var month = date.getMonth() + 1;
  //   console.log("getNowDateAddYaer", month);
  var strDate = date.getDate();
  if (month >= 1 && month <= 9) {
    month = "0" + month;
  }
  if (strDate >= 0 && strDate <= 9) {
    strDate = "0" + strDate;
  }
  var currentdate = year + seperator1 + month + seperator1 + strDate;
  return currentdate;
};
module.exports = { getNowFormatDate, getNowInUserDateAdd30, getNowDateAddYaer };
